package o;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.animation.TimeInterpolator;
import android.view.View;
import o.nn.c;

public class nw {

    static class e extends AnimatorListenerAdapter {
        private final float ʼ;
        private final float ʽ;
        private final View ˊ;
        private final int ˋ;
        private final View ˎ;
        private final int ˏ;
        private int[] ॱ = ((int[]) this.ˊ.getTag(c.ॱॱ));
        private float ॱॱ;
        private float ᐝ;

        e(View view, View view2, int i, int i2, float f, float f2) {
            this.ˎ = view;
            this.ˊ = view2;
            this.ˏ = i - Math.round(this.ˎ.getTranslationX());
            this.ˋ = i2 - Math.round(this.ˎ.getTranslationY());
            this.ʽ = f;
            this.ʼ = f2;
            if (this.ॱ != null) {
                this.ˊ.setTag(c.ॱॱ, null);
            }
        }

        public void onAnimationCancel(Animator animator) {
            if (this.ॱ == null) {
                this.ॱ = new int[2];
            }
            this.ॱ[0] = Math.round(((float) this.ˏ) + this.ˎ.getTranslationX());
            this.ॱ[1] = Math.round(((float) this.ˋ) + this.ˎ.getTranslationY());
            this.ˊ.setTag(c.ॱॱ, this.ॱ);
        }

        public void onAnimationEnd(Animator animator) {
            this.ˎ.setTranslationX(this.ʽ);
            this.ˎ.setTranslationY(this.ʼ);
        }

        public void onAnimationPause(Animator animator) {
            this.ॱॱ = this.ˎ.getTranslationX();
            this.ᐝ = this.ˎ.getTranslationY();
            this.ˎ.setTranslationX(this.ʽ);
            this.ˎ.setTranslationY(this.ʼ);
        }

        public void onAnimationResume(Animator animator) {
            this.ˎ.setTranslationX(this.ॱॱ);
            this.ˎ.setTranslationY(this.ᐝ);
        }
    }

    public static Animator ˋ(View view, nx nxVar, int i, int i2, float f, float f2, float f3, float f4, TimeInterpolator timeInterpolator) {
        float translationX = view.getTranslationX();
        float translationY = view.getTranslationY();
        int[] iArr = (int[]) nxVar.ॱ.getTag(c.ॱॱ);
        if (iArr != null) {
            f = ((float) (iArr[0] - i)) + translationX;
            f2 = ((float) (iArr[1] - i2)) + translationY;
        }
        int round = i + Math.round(f - translationX);
        int round2 = i2 + Math.round(f2 - translationY);
        view.setTranslationX(f);
        view.setTranslationY(f2);
        if (f == f3 && f2 == f4) {
            return null;
        }
        PropertyValuesHolder[] propertyValuesHolderArr = new PropertyValuesHolder[2];
        propertyValuesHolderArr[0] = PropertyValuesHolder.ofFloat(View.TRANSLATION_X, new float[]{f, f3});
        propertyValuesHolderArr[1] = PropertyValuesHolder.ofFloat(View.TRANSLATION_Y, new float[]{f2, f4});
        Animator ofPropertyValuesHolder = ObjectAnimator.ofPropertyValuesHolder(view, propertyValuesHolderArr);
        Object eVar = new e(view, nxVar.ॱ, round, round2, translationX, translationY);
        ofPropertyValuesHolder.addListener(eVar);
        mw.ˊ(ofPropertyValuesHolder, eVar);
        ofPropertyValuesHolder.setInterpolator(timeInterpolator);
        return ofPropertyValuesHolder;
    }
}
